package cn.web.demo.controller;

import cn.web.demo.model.Permission;
import cn.web.demo.service.impl.IPermissionServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class IndexController {

    @Autowired
    IPermissionServiceImpl iPermissionService;

    Logger logger= LoggerFactory.getLogger(IndexController.class);

    @RequestMapping("/index")
    public String index(Model model){
        logger.info("SSS");
        logger.error("SSS");
        logger.warn("SSS");
     List<Permission> list= iPermissionService.findMenuList();
     model.addAttribute("list", list);
        return "index";
    }

    @RequestMapping("/403")
    public String err403(){
        return "403";
    }

}
